package lab03.Test02;

import java.io.File;

public class Test02 {
    public static void main(String[] args) {
        File file=new File("D:\\");

        if (file.isDirectory()){
            String f[]=file.list();

            for (int i=0;i<f.length;i++){
                File fi=new File(file+"/"+f[i]);
                if (fi.isDirectory()) {
                    System.out.println("目录："+f[i]);
                }else
                    System.out.println("文件："+f[i]);
            }
        }
    }
}